<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="DC.Type" content="task"/>
<meta name="DC.Title" content="Adding new strings"/>
<meta name="abstract" content="Create a new string using the Localization Files Editor by adding a new row."/>
<meta name="description" content="Create a new string using the Localization Files Editor by adding a new row."/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-about.html"/>
<meta name="DC.Relation" scheme="URI" content="http://developer.android.com/guide/topics/resources/localization.html#resource-precedence"/>
<meta name="DC.Relation" scheme="URI" content="../topics/r_localization-string-editor.html"/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-new-array-adding.html"/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-string-editing.html"/>
<meta name="copyright" content="Motorola Mobility, Inc. 2009-2010" type="primary"/>
<meta name="DC.Rights.Owner" content="Motorola Mobility, Inc. 2009-2010" type="primary"/>
<meta name="DC.Format" content="XHTML"/>
<meta name="DC.Identifier" content="t_localize-new-string-adding"/>
<meta name="DC.Language" content="en-us"/>
<link rel="stylesheet" type="text/css" href="../commonltr.css"/>
<title>Adding new strings</title>
</head>
<body id="t_localize-new-string-adding"><a name="t_localize-new-string-adding"><!-- --></a>
<a class="hdr-none"/>

  <h1 class="topictitle1">Adding new strings</h1>

  
  
  <div><p>Create a new string using the Localization Files Editor by adding a new row.</p>

    <ol>
      <li>
        <span>Launch the Localization Files Editor using one of the following methods:</span>
        <ul>
          <li>Double-click <span class="filepath">res/values/strings.xml</span> (or any of the localized <span class="filepath">strings.xml</span> files in your project).</li>

          <li>Right-click <span class="filepath">res/values/strings.xml</span> (or any of the localized <span class="filepath">strings.xml</span> files in your project) and select <span class="menucascade"><span class="uicontrol">Open
                With</span> &gt; <span class="uicontrol">Other</span></span>. From the Editor Selection dialog, select
              <span class="uicontrol">Localization Files Editor</span> and click OK.</li>

        </ul>

         The Localization Files Editor appears, showing the base (or default) strings file and any localized
          strings files.
      </li>

      <li>
        <span>Right-click anywhere within the Localization Files Editor table and select <span class="uicontrol">Add Key</span>.</span>
         The <span class="uicontrol">New Row</span> dialog appears.
      </li>

      <li>
        <span>Ensure that <span class="uicontrol">Add new</span> is set to <span class="uicontrol">String</span>.</span>
      </li>

      <li>
        <span>In the <span class="uicontrol">Row key</span> field, enter the key that will be used to access the new
        string.</span>
      </li>

      <li>
        <span>Click <span class="uicontrol">OK</span>.</span>
         A new, empty row is added to the table identified by the supplied key. Note that a warning icon
            (<img src="../images/localization-warning-icon.png"/>) appears next to the key, indicating that the
          default strings file does not yet have a value defined for this key.
      </li>

      <li>
        <span>Enter string values for the key in the appropriate columns. Generally you will enter a default, or base,
          string in the <span class="uicontrol">values</span> column and localized versions of that string in columns for those
          locales in which the default string is not appropriate. Note that you can enter multi-line string values by
          pressing the Return key between lines.</span>
      </li>

      <li>
        <span>Select <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Save</span></span> to save your
          changes.</span>
      </li>

    </ol>

    <div class="section">To remove a string simply right-click within the row and select <span class="uicontrol">Remove
    Key</span>.</div>

  </div>

<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/t_localize-about.html" title="Using the Localization Files Editor, you can easily create text string files for new locales, see which strings will be used in a given locale, and identify strings that have yet to be translated, all without having to work directly in XML-formatted files. It makes it easy to add new strings across multiple locales, and edit localized strings.">Localizing Text Strings</a></div>
</div>
<div class="relinfo"><strong>Related tasks</strong><br/>
<div><a href="../topics/t_localize-new-array-adding.html" title="Create a new string array resource using the Localization Files Editor.">Adding new string arrays</a></div>
<div><a href="../topics/t_localize-string-editing.html" title="Use the Localization Files Editor to create localized versions of text strings used in your applications.">Editing a localized string</a></div>
</div>
<div class="relinfo"><strong>Related reference</strong><br/>
<div><a href="../topics/r_localization-string-editor.html" title="Allows you to easily create text string files for new locales, to see which strings will be used in a given locale, and to identify strings that have yet to be translated, all without having to work directly in XML-formatted files.">Localization Files Editor</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br/>
<div><a href="http://developer.android.com/guide/topics/resources/localization.html#resource-precedence" target="_blank">Which Resources Take Precedence?</a></div>
</div>
</div>

</body>
</html>